export default {
    namespaced: true,
    //数据
    state: {
        //是否显示提示框
        isShowToast: false,
        //提示内容
        toastMsg: "手机号",
        //提示类型
        toastType: "类型"
    },
    getters: {

    },
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShowToast = payload.isshow
            if (payload.isshow) {
                state.toastMsg = payload.msg;
                state.toastType = payload.type
            }
        }
    },
    actions: {
        asyncChangeIsShowToast(context, payload) {
            //调用mutations中方法
            context.commit("changeIsShowToast", payload);
            setTimeout(() => {
                context.commit("changeIsShowToast", {
                    isshow: false,
                })
            }, 1500);
        }
    }
}